package com.xiaofan.mapper;

import com.xiaofan.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author 晓帆
 * @version 1.0
 **/
public interface UserMapper {
    @Select("select * from `user` where id=#{id} ")
    User getUser(Integer id);
    @Update({"<script>",
            "update user",
            "<set>",
            "<if test='username!=null'",
            "username=#{username} ",
            "</script>"})
    Integer updateAch(User user);
}
